package part22_适配器模式.适配器模式解决接口返回值问题;

import java.util.*;

/**
 * @ClassName: UserServiceImpl
 * @Author: AllenSun
 * @Date: 2023/2/12 上午1:36
 */
public class UserServiceImpl implements UserService {
    @Override
    public Map findById() {
        Map map = new LinkedHashMap();
        map.put("user_id",1234);
        map.put("username","zhangsan");
        // 返回一个模拟的用户信息
        return map;
    }

    @Override
    public List<Map> findUsers() {
        List<Map> list = new ArrayList<>();
        for (int i = 0; i <=10 ; i++) {
            Map map = new LinkedHashMap();
            map.put("user_id",new Random().nextInt(100000));
            map.put("username","user"+i);
            list.add(map);
        }
        // 返回一个模拟的list用户信息
        return list;
    }
}
